<template>
  <el-container class="common-layout">
    <el-header>
      <div class="left">
        <img src="../assets/heima.png" alt="" />
        <span>电商管理后台系统</span>
      </div>
      <el-button @click="back">退出</el-button>
    </el-header>
    <el-container>
      <el-aside width="auto">
        <LeftNav />
      </el-aside>
      <el-main><router-view /></el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import LeftNav from "../components/LeftNav.vue";
import { useRouter } from "vue-router";

const router = useRouter();

const back = () => {
  window.sessionStorage.clear();
  router.push("/login");
};
</script>

<style lang="less" scoped>
.common-layout {
  height: 100%;
}
.common-layout header {
  background-color: #373d41;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  span {
    line-height: 30px;
    color: white;
    margin-left: 20px;
    font-size: 22px;
  }
  .left {
    display: flex;
    align-items: center;
  }
}
.common-layout aside {
  background-color: #333744;
}
</style>
